<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('下拉框')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<body class="gray-bg">
<form>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>下拉框
                            <small>https://github.com/select2/select2</small>
                        </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="font-noraml">单选</label>
                            <select class="form-control">
                                <option value="">--请选择开发语言--</option>
                                <option value="Java">Java</option>
                                <option value="PHP">PHP</option>
                                <option value=".NET">.NET</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">分组单选</label>
                            <select class="form-control">
                                <optgroup label="--请选择开发语言--">
                                    <option value="Java">Java</option>
                                    <option value="PHP">PHP</option>
                                    <option value=".NET">.NET</option>
                                </optgroup>
                                <optgroup label="--请选择数据库--">
                                    <option value="Oracle">Oracle</option>
                                    <option value="Mysql">Mysql</option>
                                    <option value="Sysbase">Sysbase</option>
                                </optgroup>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">多选</label>
                            <select class="form-control select2-multiple" multiple>
                                <option value="">请选择开发语言</option>
                                <option value="Java">Java</option>
                                <option value="PHP">PHP</option>
                                <option value=".NET">.NET</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">分组多选</label>
                            <select class="form-control select2-multiple" multiple>
                                <optgroup label="--请选择开发语言--">
                                    <option value="Java">Java</option>
                                    <option value="PHP">PHP</option>
                                    <option value=".NET">.NET</option>
                                </optgroup>
                                <optgroup label="--请选择数据库--">
                                    <option value="Oracle">Oracle</option>
                                    <option value="Mysql">Mysql</option>
                                    <option value="Sysbase">Sysbase</option>
                                </optgroup>
                            </select>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="font-noraml">相关参数详细信息</label>
                            <div><a href="http://doc.ruoyi.vip/#/standard/zjwd?id=select2" target="_blank">http://doc.ruoyi.vip/#/standard/zjwd?id=select2</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>下拉框
                            <small>https://github.com/snapappointments/bootstrap-select</small>
                        </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="font-noraml">单选</label>
                            <select class="form-control noselect2 selectpicker">
                                <option value="">--请选择开发语言--</option>
                                <option value="Java">Java</option>
                                <option value="PHP">PHP</option>
                                <option value=".NET">.NET</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">分组多选</label>
                            <select class="form-control noselect2 selectpicker">
                                <optgroup label="--请选择开发语言--">
                                    <option value="Java">Java</option>
                                    <option value="PHP">PHP</option>
                                    <option value=".NET">.NET</option>
                                </optgroup>
                                <optgroup label="--请选择数据库--">
                                    <option value="Oracle">Oracle</option>
                                    <option value="Mysql">Mysql</option>
                                    <option value="Sysbase">Sysbase</option>
                                </optgroup>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">多选</label>
                            <select class="form-control noselect2 selectpicker" data-none-selected-text="请选择开发语言"
                                    multiple>
                                <option value="Java">Java</option>
                                <option value="PHP">PHP</option>
                                <option value=".NET">.NET</option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="font-noraml">分组多选</label>
                            <select class="form-control noselect2 selectpicker" data-none-selected-text="请选择" multiple>
                                <optgroup label="--请选择开发语言--">
                                    <option value="Java">Java</option>
                                    <option value="PHP">PHP</option>
                                    <option value=".NET">.NET</option>
                                </optgroup>
                                <optgroup label="--请选择数据库--">
                                    <option value="Oracle">Oracle</option>
                                    <option value="Mysql">Mysql</option>
                                    <option value="Sysbase">Sysbase</option>
                                </optgroup>
                            </select>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="font-noraml">相关参数详细信息</label>
                            <div><a href="http://doc.ruoyi.vip/#/standard/zjwd?id=bootstrap-select" target="_blank">http://doc.ruoyi.vip/#/standard/zjwd?id=bootstrap-select</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-select-js"/>
<script type="text/javascript">
    $(function () {
        <!-- datetimepicker示例 -->
        $("#datetimepicker-demo-1").datetimepicker();

        $("#datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("#datetimepicker-demo-3").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            autoclose: true
        });

        $('.form_date').datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("#datetimepicker-startTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn: true,
            autoclose: true,
            endDate: new Date(),
        }).on('changeDate', function (event) {
            event.preventDefault();
            event.stopPropagation();
            var startTime = event.date;
            $('#datetimepicker-endTime').datetimepicker('setStartDate', startTime);
        });

        $("#datetimepicker-endTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn: true,
            autoclose: true,
            endDate: new Date(),
        }).on('changeDate', function (event) {
            event.preventDefault();
            event.stopPropagation();
            var endTime = event.date;
            $("#datetimepicker-startTime").datetimepicker('setEndDate', endTime);
        });

        <!-- laydate示例 -->
        layui.use('laydate', function () {
            var laydate = layui.laydate;

            laydate.render({
                elem: '#laydate-demo-1'
            });

            laydate.render({
                elem: '#laydate-demo-2',
                type: 'date'
            });

            laydate.render({
                elem: '#laydate-demo-3',
                type: 'datetime'
            });

            laydate.render({
                elem: '#laydate-demo-4',
                range: true
            });

            var startDate = laydate.render({
                elem: '#laydate-startTime',
                max: $('#laydate-endTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function (value, date) {
                    // 结束时间大于开始时间
                    if (value !== '') {
                        endDate.config.min.year = date.year;
                        endDate.config.min.month = date.month - 1;
                        endDate.config.min.date = date.date;
                    } else {
                        endDate.config.min.year = '';
                        endDate.config.min.month = '';
                        endDate.config.min.date = '';
                    }
                }
            });

            var endDate = laydate.render({
                elem: '#laydate-endTime',
                min: $('#laydate-startTime').val(),
                theme: 'molv',
                trigger: 'click',
                done: function (value, date) {
                    // 开始时间小于结束时间
                    if (value !== '') {
                        startDate.config.max.year = date.year;
                        startDate.config.max.month = date.month - 1;
                        startDate.config.max.date = date.date;
                    } else {
                        startDate.config.max.year = '';
                        startDate.config.max.month = '';
                        startDate.config.max.date = '';
                    }
                }
            });
        });
    });
</script>
</body>
</html>
